from django.contrib import admin
import xadmin
from suggest.models import *


class FlowXadmin(object):
    list_display = ['id', 'name', 'is_active', 'remark']
    list_display_link = ['id', 'name']


class FlowRoleXadmin(object):
    list_display = ['id', 'name', 'role_type', 'remark']


class OperationOptionXadmin(object):
    list_display = ['id', 'name', 'remark']


class FlowNodeXadmin(object):
    list_display = ['id', 'flow', 'flow_node_name', 'node_type', 'order', 'pre_node', 'next_node', 'flow_role',
                    'flow_operation', 'remark']
    list_display_links = ['id', 'flow_node_name', 'node_type']


class SuggestXadmin(object):
    list_display = ['id', 'title', 'current_situation', 'proposed_solution', 'benefit', 'resource',
                    'create_user', 'create_at', 'update_at', 'state']
    list_display_links = ['id', 'title']


class SuggestAuditXadmin(object):
    list_display = ['id', 'operation', 'audit_user', 'audit_time', 'audit_suggest', 'suggest', 'flow_node']
    list_display_links = ['id', 'suggest', 'operation']


class ProjectXadmin(object):
    list_display = ['id', 'suggest', 'in_charge', 'create_user', 'verify_user', 'verify_result', 'benefit_money',
                    'estimate_at', 'finish_at', 'create_at', 'update_at']
    list_display_links = ['id', 'suggest']


class ProjectRecordXadmin(object):
    list_display = ['id', 'project', 'content', 'create_user', 'create_at']
    list_display_links = list_display


xadmin.site.register(Flow, FlowXadmin)
xadmin.site.register(FlowNode, FlowNodeXadmin)
xadmin.site.register(OperationOption, OperationOptionXadmin)
xadmin.site.register(FlowRole, FlowRoleXadmin)
xadmin.site.register(Suggest, SuggestXadmin)
xadmin.site.register(SuggestAudit, SuggestAuditXadmin)
xadmin.site.register(Project, ProjectXadmin)
xadmin.site.register(ProjectRecord, ProjectRecordXadmin)
